l = ["abcd", "abc", "ab"]
w = [""]
k = len(l)
a = 0
b = 0
c = ""
i = min([len(z) for z in l])

for _ in range(0, i):
    if i == 0:
        c = ""

    elif l[a][b] == l[a+1][b] and l[a][b] == l[a+2][b]:
        c += l[a][b]
        b += 1

print(c)


l = ["abcd", "abc", "ab", "ab"]

n_1 = 0
n_2 = 0
n_3 = 0
s_1 = ""
k_1 = min([len(i) for i in l])

while True:
    if l[n_1][n_2] == l[n_1+1][n_2]:
        n_1 += 1
        if n_1 < len(l)-1:
            continue
        elif n_1 == len(l)-1:
            s_1 += l[n_1][n_2]
            n_1 = 0
            n_2 += 1
    else:
        break

print(s_1)




